const config = require('../config');
const Redis = require('ioredis');
const logger = require('./logger');

var client = new Redis({
    port: config.redis_port,
    host: config.redis_host,
    db: config.redis_db,
    password: config.redis_password,
});

client.on('error', function (err) {
    if(err) {
        logger.error('connect ro redis error, check your redis config', err);
    }
});

exports = module.exports = client;